// hello.csx
// #r "T:\Users\chenx\source\repos\WebApplicationTest\bin\Newtonsoft.Json.dll"
#r "nuget: Newtonsoft.Json, 13.0.3"
using Newtonsoft.Json;

Console.WriteLine("Hello, World!");


var person = new {
    Name = "John Doe",
    Age = 30,
    Address = new {
        Street = "123 Main St",
        City = "Sample City"
    }
};

string jsonString = JsonConvert.SerializeObject(person, Formatting.Indented);
Console.WriteLine(jsonString);



 jsonString = @"{
    ""Name"": ""John Doe"",
    ""Age"": 30,
    ""Address"": {
        ""Street"": ""123 Main St"",
        ""City"": ""Sample City""
    }
}";

var person2 = JsonConvert.DeserializeObject<dynamic>(jsonString);
Console.WriteLine($"Name: {person.Name}, Age: {person.Age}");
Console.WriteLine($"Address: {person.Address.Street}, {person.Address.City}");

